package com.yq.socket1.day1.v3;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/01 10:20
 */
public class Server {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ServerSocket serverSocket = new ServerSocket(8888);

        Socket socket = serverSocket.accept();

        InputStream in = socket.getInputStream();
        ObjectInputStream ob = new ObjectInputStream(in);
        Object o = ob.readObject();
        System.out.println(o);
        // ob.close();
        socket.close();
        serverSocket.close();
    }
}
